package com.jxau.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jxau.dao.AdminDao;
import com.jxau.domain.Admin;
import com.jxau.service.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AdminServiceImpl extends ServiceImpl<AdminDao, Admin> implements AdminService {
    @Resource
    private AdminDao adminDao;

    @Override
    public boolean login(Admin admin) {
        QueryWrapper<Admin> qw = new QueryWrapper<>();
        qw.eq("username", admin.getUsername());
        Admin admin1 = adminDao.selectOne(qw);
        return admin1 != null && admin1.getPassword().equals(admin.getPassword());
    }

}
